/* 2014/8/22 */
package com.cosmos.quartz.control.xml;

import com.cosmos.quartz.control.ControlResponse;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;

@XStreamAlias("response")
public class XmlControlResponse {

	@XStreamAlias("succeed")
	private boolean succeed;
	
	@XStreamAlias("message")
	private String message;	

	@XStreamAlias("report")
	private String report;
	
	@XStreamOmitField
	private XmlControlRequest request;
	
	public XmlControlResponse() {
		
	}
	
	public XmlControlResponse(ControlResponse response) {
		message = response.getMessage();
		succeed = response.isSucceed();
		report = response.getReport();
	}
	
	public ControlResponse toBaseResponse() {
		ControlResponse response = new ControlResponse();
		response.setMessage(message);
		response.setSucceed(succeed);
		response.setReport(report);
		return response;
	}

	public boolean isSucceed() {
		return succeed;
	}

	public void setSucceed(boolean succeed) {
		this.succeed = succeed;
	}
	
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public String getReport() {
		return report;
	}

	public void setReport(String report) {
		this.report = report;
	}
	
	public XmlControlRequest getRequest() {
		return request;
	}

	public void setRequest(XmlControlRequest request) {
		this.request = request;
	}
	
}
